import nonebot
from nonebot.adapters.onebot.v11 import Adapter as OneBotAdapter
from src.core.napcat.global_napcat import get_global_napcat

# 初始化 NoneBot
nonebot.init()

# 注册适配器
driver = nonebot.get_driver()
driver.register_adapter(OneBotAdapter)

@driver.on_startup
async def on_startup():
    pass

@driver.on_shutdown
async def on_shutdown():
    pass

@driver.on_bot_connect
async def on_bot_connect(bot):
    napcat = get_global_napcat()
    napcat.hello_to_manager()

nonebot.load_plugins("src/plugins/napcat")

if __name__ == "__main__":
    nonebot.run()